package com.interagriculture.controller;

import com.interagriculture.common.PageResult;
import com.interagriculture.common.Result;
import com.interagriculture.entity.Data;
import com.interagriculture.entity.query.DataQuery;
import com.interagriculture.service.DataService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Data)表控制层
 *
 * @author makejava
 * @since 2024-10-24 19:14:05
 */
@RestController
@RequestMapping("/data")
public class DataController {
    /**
     * 服务对象
     */
    @Resource
    private DataService dataService;

    @GetMapping("/getInfomation")
    public Result<PageResult> getInfomation(@RequestBody(required = false) DataQuery dataQuery){
        PageResult result = dataService.findByPage(dataQuery);
        return Result.ok(result);
    }
}

